/**
 ***********************************************************************************************************************
 * Copyright (c) 2020, China Mobile Communications Group Co.,Ltd.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
 * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the License.
 *
 * @file        tts_audio.h
 *
 * @brief       tts external API
 *
 * @revision
 * Date         Author          Notes
 * 2020-11-20   OneOS Team      First Version
 ***********************************************************************************************************************
 */


struct tts_config
{
    char api_key[40];    // 填写网页上申请的appkey 如 $apiKey="g8eBUMSokVB1BHGmgxxxxxx"
    char secret_key[40]; // 填写网页上申请的APP SECRET 如 $secretKey="94dc99566550d87f8fa8ece112xxxxx"
    char token[80];
    char cuid[20];
    int spd;
    int pit;
    int vol;
    int per;
    int aue;
    char format[4];
};

//文本转语音，并播放
int tts_player(char *text, unsigned encoding);

//初始化tts基本配置，获取token
void tts_aivoice_config(const char *api_key, const char *secret_key);

// 发音人选择, 基础音库：0为度小美，1为度小宇，3为度逍遥，4为度丫丫
void tts_aivoice_per(int per);

// 语速，取值0-9，默认为5中语速
void tts_aivoice_spd(int spd);

// #音调，取值0-9，默认为5中语调
void tts_aivoice_pit(int pit);

// #音量，取值0-9，默认为5中音量
void tts_aivoice_vol(int vol);

// 下载的文件格式, 3：mp3(default) 4： pcm-16k 5： pcm-8k 6. wav
void tts_aivoice_aue(int aue);

//IMEI addresses are recommended
void tts_aivoice_cuid(char *cuid);
